<template>
    <div id="pagehome">

    </div>
</template>

<script>
    export default {
        data() {
            return {
                map: null,
            }
        },
        mounted() {
            this.drawMap()
        },
        methods: {
            //初始化图层
            drawMap() {
                let imga = new L.TileLayer("/globle/tiles/imga/{z}/{y}/{x}.jpg", {
                    minZoom: 9,
                    maxZoom: 10,
                    attribution: "卫星地图",
                });//线路
                let imgm = new L.TileLayer("/globle/tiles/imgm/{z}/{y}/{x}.jpg", {
                    minZoom: 9,
                    maxZoom: 10,
                    attribution: "卫星地图",
                });
                var glayerSatelite = L.layerGroup([imgm]);
                let latlng = new L.LatLng(31.198706347135246, 121.4813232421875);
                this.map = new L.Map("pagehome", {
                    center: latlng,
                    zoom: 8,
                    layers: [glayerSatelite],
                    zoomControl: false,
                    Legend: true,
                    attributionControl: false,
                });
            },
        }
    }
</script>

<style scoped>
    #pagehome {
        width: 100%;
        height: 100%;
    }
</style>